<?php
class CartPanel_Form_ProductType extends Ext_Form
{
    public function init()
    {
        // Set the method for the display form to POST
        $this->setMethod('post');

		$this->addElement('text', 'name', array(
            'label'      => 'Nombre:',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array( 'alnum')
        ));		
        
		$this->addElement('select', 'tax_class_id', array(
            'label'      => 'Tax class:',
            'required'   => false,
            'filters'    => array(),
            'validators' => array( 'int')
        ));
        
        $taxClass = new CartWS_Model_TaxClass();
        $this->tax_class_id->setMultiOptions( 
        	$taxClass->getActiveAsArray() 
        );
        
		$this->addElement('select', 'organization_id', array(
            'label'      => 'Organizacion:',
            'required'   => true,
            'filters'    => array(),
            'validators' => array( 'int')
        ));
        
        $organization = new CartWS_Model_Organization();
        $this->organization_id->setMultiOptions( 
        	$organization->getActiveAsArray() 
        );
        
        // Add the submit button
        $this->addElement( new Ext_Form_Element_Toolbar('Enviar' ) );

    }
}

